home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 401-425 / disk_407 / flex / src.lzh / src / parse.c < prev    next >
C/C++ Source or Header  |  1990-07-14  |  45KB  |  1,657 lines

  1.  
  2. /*  A Bison parser, made from parse.y  */
  3.  
  4. #define    CHAR    258
  5. #define    NUMBER    259
  6. #define    SECTEND    260
  7. #define    SCDECL    261
  8. #define    XSCDECL    262
  9. #define    WHITESPACE    263
  10. #define    NAME    264
  11. #define    PREVCCL    265
  12. #define    EOF_OP    266
  13.  
  14. #line 6 "parse.y"
  15.  
  16. /*-
  17.  * Copyright (c) 1990 The Regents of the University of California.
  18.  * All rights reserved.
  19.  *
  20.  * This code is derived from software contributed to Berkeley by
  21.  * Vern Paxson.
  22.  * 
  23.  * The United States Government has rights in this work pursuant
  24.  * to contract no. DE-AC03-76SF00098 between the United States
  25.  * Department of Energy and the University of California.
  26.  *
  27.  * Redistribution and use in source and binary forms are permitted provided
  28.  * that: (1) source distributions retain this entire copyright notice and
  29.  * comment, and (2) distributions including binaries display the following
  30.  * acknowledgement:  ``This product includes software developed by the
  31.  * University of California, Berkeley and its contributors'' in the
  32.  * documentation or other materials provided with the distribution and in
  33.  * all advertising materials mentioning features or use of this software.
  34.  * Neither the name of the University nor the names of its contributors may
  35.  * be used to endorse or promote products derived from this software without
  36.  * specific prior written permission.
  37.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  38.  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  39.  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  40.  */
  41.  
  42. #ifndef lint
  43. static char rcsid[] =
  44.     "@(#) $Header: /usr/fsys/odin/a/vern/flex/RCS/parse.y,v 2.7 90/06/27 23:48:31 vern Exp $ (LBL)";
  45. #endif
  46.  
  47. #include "flexdef.h"
  48.  
  49. int pat, scnum, eps, headcnt, trailcnt, anyccl, lastchar, i, actvp, rulelen;
  50. int trlcontxt, xcluflg, cclsorted, varlength, variable_trail_rule;
  51. Char clower();
  52. void build_eof_action();
  53. void yyerror( char * );
  54.  
  55. static int madeany = false;  /* whether we've made the '.' character class */
  56. int previous_continued_action;    /* whether the previous rule's action was '|' */
  57.  
  58.  
  59. #ifndef YYLTYPE
  60. typedef
  61.   struct yyltype
  62.     {
  63.       int timestamp;
  64.       int first_line;
  65.       int first_column;
  66.       int last_line;
  67.       int last_column;
  68.       char *text;
  69.    }
  70.   yyltype;
  71.  
  72. #define YYLTYPE yyltype
  73. #endif
  74.  
  75. #define    YYACCEPT    return(0)
  76. #define    YYABORT    return(1)
  77. #define    YYERROR    goto yyerrlab
  78. #ifndef YYSTYPE
  79. #define YYSTYPE int
  80. #endif
  81. #ifndef stdin
  82. #include <stdio.h>
  83. #endif
  84.  
  85. #ifndef __STDC__
  86. #define const
  87. #endif
  88.  
  89.  
  90.  
  91. #define    YYFINAL        81
  92. #define    YYFLAG        -32768
  93. #define    YYNTBASE    32
  94.  
  95. #define YYTRANSLATE(x) ((unsigned)(x) <= 266 ? yytranslate[x] : 51)
  96.  
  97. static const char yytranslate[] = {     0,
  98.      2,     2,     2,     2,     2,     2,     2,     2,     2,    12,
  99.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  100.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  101.      2,     2,     2,    26,     2,    17,     2,     2,     2,    27,
  102.     28,    20,    21,    16,    31,    25,    19,     2,     2,     2,
  103.      2,     2,     2,     2,     2,     2,     2,     2,     2,    14,
  104.      2,    15,    22,     2,     2,     2,     2,     2,     2,     2,
  105.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  106.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  107.     29,     2,    30,    13,     2,     2,     2,     2,     2,     2,
  108.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  109.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  110.      2,     2,    23,    18,    24,     2,     2,     2,     2,     2,
  111.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  112.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  113.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  114.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  115.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  116.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  117.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  118.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  119.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  120.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  121.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  122.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  123.      2,     2,     2,     2,     2,     1,     2,     3,     4,     5,
  124.      6,     7,     8,     9,    10,    11
  125. };
  126.  
  127. static const short yyrline[] = {     0,
  128.     52,    76,    85,    86,    87,    91,    94,   104,   108,   111,
  129.    114,   118,   119,   122,   133,   153,   164,   188,   199,   202,
  130.    221,   225,   228,   238,   247,   251,   308,   311,   351,   367,
  131.    373,   378,   403,   411,   415,   422,   429,   436,   454,   468,
  132.    486,   508,   525,   532,   535,   538,   549,   552,   566,   594,
  133.    606,   614,   625
  134. };
  135.  
  136. static const char * const yytname[] = {     0,
  137. "error","$illegal.","CHAR","NUMBER","SECTEND","SCDECL","XSCDECL","WHITESPACE","NAME","PREVCCL",
  138. "EOF_OP","'\\n'","'^'","'<'","'>'","','","'$'","'|'","'/'","'*'",
  139. "'+'","'?'","'{'","'}'","'.'","'\"'","'('","')'","'['","']'",
  140. "'-'","goal"
  141. };
  142.  
  143. static const short yyr1[] = {     0,
  144.     32,    33,    34,    34,    34,    35,    36,    36,    37,    37,
  145.     37,    38,    38,    39,    40,    40,    40,    40,    40,    40,
  146.     40,    41,    42,    42,    42,    43,    43,    43,    43,    44,
  147.     44,    45,    46,    46,    47,    47,    47,    47,    47,    47,
  148.     47,    47,    47,    47,    47,    47,    48,    48,    49,    49,
  149.     49,    50,    50
  150. };
  151.  
  152. static const short yyr2[] = {     0,
  153.      5,     0,     5,     0,     2,     1,     1,     1,     3,     1,
  154.      1,     4,     0,     0,     3,     2,     2,     1,     2,     1,
  155.      1,     3,     3,     1,     1,     2,     3,     2,     1,     3,
  156.      1,     2,     2,     1,     2,     2,     2,     6,     5,     4,
  157.      1,     1,     1,     3,     3,     1,     3,     4,     4,     2,
  158.      0,     2,     0
  159. };
  160.  
  161. static const short yydefact[] = {     2,
  162.      0,     0,     0,     5,     6,     7,     8,    13,     0,    14,
  163.      0,     0,    11,    10,     0,    21,    46,    43,    20,     0,
  164.      0,    41,    53,     0,    51,     0,     0,    18,    29,     0,
  165.     31,    34,    42,     0,     3,    17,    25,    24,     0,     0,
  166.      0,    51,     0,    12,    19,     0,    16,    28,     0,    32,
  167.     26,    33,    35,    36,    37,     0,     9,    22,     0,    52,
  168.     44,    45,     0,    50,    47,    15,    30,    27,     0,    23,
  169.     48,     0,     0,    40,    49,     0,    39,    38,     0,     0,
  170.      0
  171. };
  172.  
  173. static const short yydefgoto[] = {    79,
  174.      1,     3,     8,     9,    15,    10,    12,    26,    27,    39,
  175.     28,    29,    30,    31,    32,    33,    43,    40
  176. };
  177.  
  178. static const short yypact[] = {-32768,
  179.     55,    -2,    63,-32768,-32768,-32768,-32768,-32768,    16,-32768,
  180.     12,     1,-32768,-32768,    51,-32768,-32768,-32768,-32768,    19,
  181.     33,-32768,-32768,    19,    -6,     8,    28,-32768,    54,    19,
  182.     19,    44,-32768,    38,-32768,-32768,-32768,-32768,    34,    14,
  183.    -10,-32768,     2,-32768,-32768,    19,-32768,-32768,    19,-32768,
  184.     57,    44,-32768,-32768,-32768,    48,-32768,-32768,    49,-32768,
  185. -32768,-32768,     3,     6,-32768,-32768,    19,-32768,    27,-32768,
  186. -32768,    73,    -1,-32768,-32768,    53,-32768,-32768,    78,    79,
  187. -32768
  188. };
  189.  
  190. static const short yypgoto[] = {-32768,
  191. -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  192.    -11,    -5,-32768,    31,   -31,-32768,    39,-32768
  193. };
  194.  
  195.  
  196. #define    YYLAST        81
  197.  
  198.  
  199. static const short yytable[] = {    52,
  200.     -1,    16,    76,    17,    64,    64,    42,    49,    36,     4,
  201.     18,    19,    13,    20,    21,    47,    60,    62,    41,    44,
  202.     14,    17,    77,    11,    51,    22,    23,    24,    18,    25,
  203.     17,    65,    71,    37,    66,    52,    72,    18,    45,    61,
  204.     46,    38,    73,    22,    23,    24,    57,    25,    58,    59,
  205.     74,    69,    22,    23,    24,     2,    25,    70,    34,    -4,
  206.     -4,    -4,    35,    53,    54,    55,    56,     5,     6,     7,
  207.     48,    49,    50,    68,    49,    75,    78,    80,    81,    67,
  208.     63
  209. };
  210.  
  211. static const short yycheck[] = {    31,
  212.      0,     1,     4,     3,     3,     3,    13,    18,    20,    12,
  213.     10,    11,     1,    13,    14,    27,     3,    28,    24,    12,
  214.      9,     3,    24,     8,    30,    25,    26,    27,    10,    29,
  215.      3,    30,    30,     1,    46,    67,    31,    10,    11,    26,
  216.     13,     9,    16,    25,    26,    27,     9,    29,    15,    16,
  217.     24,     4,    25,    26,    27,     1,    29,     9,     8,     5,
  218.      6,     7,    12,    20,    21,    22,    23,     5,     6,     7,
  219.     17,    18,    19,    17,    18,     3,    24,     0,     0,    49,
  220.     42
  221. };
  222. #define YYPURE 1
  223.  
  224. #line 2 "bison.simple"
  225.  
  226. /* Skeleton output parser for bison,
  227.    copyright (C) 1984 Bob Corbett and Richard Stallman
  228.  
  229.                        NO WARRANTY
  230.  
  231.   BECAUSE THIS PROGRAM IS LICENSED FREE OF CHARGE, WE PROVIDE ABSOLUTELY
  232. NO WARRANTY, TO THE EXTENT PERMITTED BY APPLICABLE STATE LAW.  EXCEPT
  233. WHEN OTHERWISE STATED IN WRITING, FREE SOFTWARE FOUNDATION, INC,
  234. RICHARD M. STALLMAN AND/OR OTHER PARTIES PROVIDE THIS PROGRAM "AS IS"
  235. WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
  236. BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  237. FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY
  238. AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE PROGRAM PROVE
  239. DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
  240. CORRECTION.
  241.  
  242.  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL RICHARD M.
  243. STALLMAN, THE FREE SOFTWARE FOUNDATION, INC., AND/OR ANY OTHER PARTY
  244. WHO MAY MODIFY AND REDISTRIBUTE THIS PROGRAM AS PERMITTED BELOW, BE
  245. LIABLE TO YOU FOR DAMAGES, INCLUDING ANY LOST PROFITS, LOST MONIES, OR
  246. OTHER SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
  247. USE OR INABILITY TO USE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR
  248. DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY THIRD PARTIES OR
  249. A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS) THIS
  250. PROGRAM, EVEN IF YOU HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
  251. DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY.
  252.  
  253.                 GENERAL PUBLIC LICENSE TO COPY
  254.  
  255.   1. You may copy and distribute verbatim copies of this source file
  256. as you receive it, in any medium, provided that you conspicuously and
  257. appropriately publish on each copy a valid copyright notice "Copyright
  258. (C) 1985 Free Software Foundation, Inc."; and include following the
  259. copyright notice a verbatim copy of the above disclaimer of warranty
  260. and of this License.  You may charge a distribution fee for the
  261. physical act of transferring a copy.
  262.  
  263.   2. You may modify your copy or copies of this source file or
  264. any portion of it, and copy and distribute such modifications under
  265. the terms of Paragraph 1 above, provided that you also do the following:
  266.  
  267.     a) cause the modified files to carry prominent notices stating
  268.     that you changed the files and the date of any change; and
  269.  
  270.     b) cause the whole of any work that you distribute or publish,
  271.     that in whole or in part contains or is a derivative of this
  272.     program or any part thereof, to be licensed at no charge to all
  273.     third parties on terms identical to those contained in this
  274.     License Agreement (except that you may choose to grant more extensive
  275.     warranty protection to some or all third parties, at your option).
  276.  
  277.     c) You may charge a distribution fee for the physical act of
  278.     transferring a copy, and you may at your option offer warranty
  279.     protection in exchange for a fee.
  280.  
  281. Mere aggregation of another unrelated program with this program (or its
  282. derivative) on a volume of a storage or distribution medium does not bring
  283. the other program under the scope of these terms.
  284.  
  285.   3. You may copy and distribute this program (or a portion or derivative
  286. of it, under Paragraph 2) in object code or executable form under the terms
  287. of Paragraphs 1 and 2 above provided that you also do one of the following:
  288.  
  289.     a) accompany it with the complete corresponding machine-readable
  290.     source code, which must be distributed under the terms of
  291.     Paragraphs 1 and 2 above; or,
  292.  
  293.     b) accompany it with a written offer, valid for at least three
  294.     years, to give any third party free (except for a nominal
  295.     shipping charge) a complete machine-readable copy of the
  296.     corresponding source code, to be distributed under the terms of
  297.     Paragraphs 1 and 2 above; or,
  298.  
  299.     c) accompany it with the information you received as to where the
  300.     corresponding source code may be obtained.  (This alternative is
  301.     allowed only for noncommercial distribution and only if you
  302.     received the program in object code or executable form alone.)
  303.  
  304. For an executable file, complete source code means all the source code for
  305. all modules it contains; but, as a special exception, it need not include
  306. source code for modules which are standard libraries that accompany the
  307. operating system on which the executable file runs.
  308.  
  309.   4. You may not copy, sublicense, distribute or transfer this program
  310. except as expressly provided under this License Agreement.  Any attempt
  311. otherwise to copy, sublicense, distribute or transfer this program is void and
  312. your rights to use the program under this License agreement shall be
  313. automatically terminated.  However, parties who have received computer
  314. software programs from you with this License Agreement will not have
  315. their licenses terminated so long as such parties remain in full compliance.
  316.  
  317.   5. If you wish to incorporate parts of this program into other free
  318. programs whose distribution conditions are different, write to the Free
  319. Software Foundation at 675 Mass Ave, Cambridge, MA 02139.  We have not yet
  320. worked out a simple rule that can be stated here, but we will often permit
  321. this.  We will be guided by the two goals of preserving the free status of
  322. all derivatives of our free software and of promoting the sharing and reuse of
  323. software.
  324.  
  325.  
  326. In other words, you are welcome to use, share and improve this program.
  327. You are forbidden to forbid anyone else to use, share and improve
  328. what you give them.   Help stamp out software-hoarding!  */
  329.  
  330. /* This is the parser code that is written into each bison parser
  331.   when the %semantic_parser declaration is not specified in the grammar.
  332.   It was written by Richard Stallman by simplifying the hairy parser
  333.   used when %semantic_parser is specified.  */
  334.  
  335. /* Note: there must be only one dollar sign in this file.
  336.    It is replaced by the list of actions, each action
  337.    as one case of the switch.  */
  338.  
  339. #ifdef AMIGA
  340.  
  341. #define bzero(b, length) memset((b),'\0',(length))
  342. #define bcopy(b1, b2, length) memcpy((b1),(b2),(length))
  343. #define bcmp(b1, b2, length)  memcmp((b1),(b2),(length))
  344.  
  345. void
  346. memory_full ()
  347. {
  348.   printf ("Memory exhausted.\n");
  349.   exit(1);
  350. }
  351.  
  352.  
  353. char *
  354. xmalloc (size)
  355.      int size;
  356. {
  357.   extern char *malloc ();
  358.   register char *ptr = malloc (size);
  359.   if (ptr != 0) return (ptr);
  360.   memory_full ();
  361.   /*NOTREACHED*/
  362. }
  363.  
  364. char *
  365. xrealloc (old, size)
  366.      char *old;
  367.      int size;
  368. {
  369.   extern char *realloc ();
  370.   register char *ptr = realloc (old, size);
  371.   if (ptr != 0) return (ptr);
  372.   memory_full ();
  373.   /*NOTREACHED*/
  374. }
  375.  
  376. char *
  377. xcalloc (number, size)
  378.      int number, size;
  379. {
  380.   extern char *malloc ();
  381.   register int total = number * size;
  382.   register char *ptr = malloc (total);
  383.   if (ptr != 0)
  384.     {
  385.       if (total > 100)
  386.         bzero (ptr, total);
  387.       else {
  388.         /* It's not too long, so loop, zeroing by longs.
  389.            It must be safe because malloc values are always well aligned.  */
  390.         register long *zp = (long *) ptr;
  391.         register long *zl = (long *) (ptr + total - 4);
  392.         register int i = total - 4;
  393.         while (zp < zl)
  394.           *zp++ = 0;
  395.         if (i < 0)
  396.           i = 0;
  397.         while (i < total)
  398.           ptr[i++] = 0;
  399.       }
  400.       return ptr;
  401.     }
  402.   memory_full ();
  403.   /*NOTREACHED*/
  404. }
  405.  
  406. /*
  407.         alloca -- (mostly) portable public-domain implementation -- D A Gwyn
  408.  
  409.         last edit:      86/05/30        rms
  410.            include config.h, since on VMS it renames some symbols.
  411.            Use xmalloc instead of malloc.
  412.  
  413.         This implementation of the PWB library alloca() function,
  414.         which is used to allocate space off the run-time stack so
  415.         that it is automatically reclaimed upon procedure exit,
  416.         was inspired by discussions with J. Q. Johnson of Cornell.
  417.  
  418.         It should work under any C implementation that uses an
  419.         actual procedure stack (as opposed to a linked list of
  420.         frames).  There are some preprocessor constants that can
  421.         be defined when compiling for your specific system, for
  422.         improved efficiency; however, the defaults should be okay.
  423.  
  424.         The general concept of this implementation is to keep
  425.         track of all alloca()-allocated blocks, and reclaim any
  426.         that are found to be deeper in the stack than the current
  427.         invocation.  This heuristic does not reclaim storage as
  428.         soon as it becomes invalid, but it will do so eventually.
  429.  
  430.         As a special case, alloca(0) reclaims storage without
  431.         allocating any.  It is a good idea to use alloca(0) in
  432.         your main control loop, etc. to force garbage collection.
  433. */
  434.  
  435. typedef char    *pointer;               /* generic pointer type */
  436.  
  437. extern void     free();
  438. extern pointer  xmalloc();
  439.  
  440. /*
  441.         Define STACK_DIRECTION if you know the direction of stack
  442.         growth for your system; otherwise it will be automatically
  443.         deduced at run-time.
  444.  
  445.         STACK_DIRECTION > 0 => grows toward higher addresses
  446.         STACK_DIRECTION < 0 => grows toward lower addresses
  447.         STACK_DIRECTION = 0 => direction of growth unknown
  448. */
  449.  
  450. #define STACK_DIRECTION -1
  451.  
  452. #define STACK_DIR       STACK_DIRECTION /* known at compile-time */
  453.  
  454. /*
  455.         An "alloca header" is used to:
  456.         (a) chain together all alloca()ed blocks;
  457.         (b) keep track of stack depth.
  458.  
  459.         It is very important that sizeof(header) agree with malloc()
  460.         alignment chunk size.  The following default should work okay.
  461. */
  462.  
  463. #ifndef ALIGN_SIZE
  464. #define ALIGN_SIZE      sizeof(double)
  465. #endif
  466.  
  467. typedef union hdr
  468. {
  469.   char  align[ALIGN_SIZE];      /* to force sizeof(header) */
  470.   struct
  471.     {
  472.       union hdr *next;          /* for chaining headers */
  473.       char *deep;               /* for stack depth measure */
  474.     } h;
  475. } header;
  476.  
  477. /*
  478.         alloca( size ) returns a pointer to at least `size' bytes of
  479.         storage which will be automatically reclaimed upon exit from
  480.         the procedure that called alloca().  Originally, this space
  481.         was supposed to be taken from the current stack frame of the
  482.         caller, but that method cannot be made to work for some
  483.         implementations of C, for example under Gould's UTX/32.
  484. */
  485.  
  486. static header *last_alloca_header = NULL; /* -> last alloca header */
  487.  
  488. pointer
  489. alloca (size)                   /* returns pointer to storage */
  490.      unsigned   size;           /* # bytes to allocate */
  491. {
  492.   auto char     probe;          /* probes stack depth: */
  493.   register char *depth = &probe;
  494.  
  495.                                 /* Reclaim garbage, defined as all alloca()ed storage that
  496.                                    was allocated from deeper in the stack than currently. */
  497.  
  498.   {
  499.     register header     *hp;    /* traverses linked list */
  500.  
  501.     for (hp = last_alloca_header; hp != NULL;)
  502.       if (STACK_DIR > 0 && hp->h.deep > depth
  503.           || STACK_DIR < 0 && hp->h.deep < depth)
  504.         {
  505.           register header       *np = hp->h.next;
  506.  
  507.           free ((pointer) hp);  /* collect garbage */
  508.  
  509.           hp = np;              /* -> next header */
  510.         }
  511.       else
  512.         break;                  /* rest are not deeper */
  513.  
  514.     last_alloca_header = hp;    /* -> last valid storage */
  515.   }
  516.  
  517.   if (size == 0)
  518.     return NULL;                /* no allocation required */
  519.  
  520.   /* Allocate combined header + user data storage. */
  521.  
  522.   {
  523.     register pointer    new = xmalloc (sizeof (header) + size);
  524.     /* address of header */
  525.  
  526.     ((header *)new)->h.next = last_alloca_header;
  527.     ((header *)new)->h.deep = depth;
  528.  
  529.     last_alloca_header = (header *)new;
  530.  
  531.     /* User storage begins just after header. */
  532.  
  533.     return (pointer)((char *)new + sizeof(header));
  534.   }
  535. }
  536. #endif
  537.  
  538.  
  539.  
  540. #define yyerrok         (yyerrstatus = 0)
  541. #define yyclearin       (yychar = YYEMPTY)
  542. #define YYEMPTY         -2
  543. #define YYEOF           0
  544. #define YYFAIL          goto yyerrlab;
  545.  
  546. #define YYTERROR        1
  547.  
  548. #ifndef YYIMPURE
  549. #define YYLEX           yylex()
  550. #endif
  551.  
  552. #ifndef YYPURE
  553. #define YYLEX           yylex(&yylval, &yylloc)
  554. #endif
  555.  
  556. /* If nonreentrant, generate the variables here */
  557.  
  558. #ifndef YYIMPURE
  559.  
  560. int     yychar;                 /*  the lookahead symbol                */
  561. YYSTYPE yylval;                 /*  the semantic value of the           */
  562.                                 /*  lookahead symbol                    */
  563.  
  564. YYLTYPE yylloc;                 /*  location data for the lookahead     */
  565.                                 /*  symbol                              */
  566.  
  567. int yynerr;                     /*  number of parse errors so far       */
  568.  
  569. #ifdef YYDEBUG
  570. int yydebug = 0;                /*  nonzero means print parse trace     */
  571. #endif
  572.  
  573. #endif  /* YYIMPURE */
  574.  
  575.  
  576. /*  YYMAXDEPTH indicates the initial size of the parser's stacks        */
  577.  
  578. #ifndef YYMAXDEPTH
  579. #define YYMAXDEPTH 200
  580. #endif
  581.  
  582. /*  YYMAXLIMIT is the maximum size the stacks can grow to
  583.     (effective only if the built-in stack extension method is used).  */
  584.  
  585. #ifndef YYMAXLIMIT
  586. #define YYMAXLIMIT 10000
  587. #endif
  588.  
  589.  
  590. #line 165 "bison.simple"
  591. int
  592. yyparse()
  593. {
  594.   register int yystate;
  595.   register int yyn;
  596.   register short *yyssp;
  597.   register YYSTYPE *yyvsp;
  598.   YYLTYPE *yylsp;
  599.   int yyerrstatus;      /*  number of tokens to shift before error messages enabled */
  600.   int yychar1;          /*  lookahead token as an internal (translated) token number */
  601.  
  602.   short yyssa[YYMAXDEPTH];      /*  the state stack                     */
  603.   YYSTYPE yyvsa[YYMAXDEPTH];    /*  the semantic value stack            */
  604.   YYLTYPE yylsa[YYMAXDEPTH];    /*  the location stack                  */
  605.  
  606.   short *yyss = yyssa;          /*  refer to the stacks thru separate pointers */
  607.   YYSTYPE *yyvs = yyvsa;        /*  to allow yyoverflow to reallocate them elsewhere */
  608.   YYLTYPE *yyls = yylsa;
  609.  
  610.   int yymaxdepth = YYMAXDEPTH;
  611.  
  612. #ifndef YYPURE
  613.   int yychar;
  614.   YYSTYPE yylval;
  615.   YYLTYPE yylloc;
  616. #endif
  617.  
  618. #ifdef YYDEBUG
  619.   extern int yydebug;
  620. #endif
  621.  
  622.  
  623.   YYSTYPE yyval;                /*  the variable used to return         */
  624.                                 /*  semantic values from the action     */
  625.                                 /*  routines                            */
  626.  
  627.   int yylen;
  628.  
  629. #ifdef YYDEBUG
  630.   if (yydebug)
  631.     fprintf(stderr, "Starting parse\n");
  632. #endif
  633.  
  634.   yystate = 0;
  635.   yyerrstatus = 0;
  636.   yynerr = 0;
  637.   yychar = YYEMPTY;             /* Cause a token to be read.  */
  638.  
  639.   /* Initialize stack pointers.
  640.      Waste one element of value and location stack
  641.      so that they stay on the same level as the state stack.  */
  642.  
  643.   yyssp = yyss - 1;
  644.   yyvsp = yyvs;
  645.   yylsp = yyls;
  646.  
  647. /* Push a new state, which is found in  yystate  .  */
  648. /* In all cases, when you get here, the value and location stacks
  649.    have just been pushed. so pushing a state here evens the stacks.  */
  650. yynewstate:
  651.  
  652.   *++yyssp = yystate;
  653.  
  654.   if (yyssp >= yyss + yymaxdepth - 1)
  655.     {
  656.       /* Give user a chance to reallocate the stack */
  657.       /* Use copies of these so that the &'s don't force the real ones into memory. */
  658.       YYSTYPE *yyvs1 = yyvs;
  659.       YYLTYPE *yyls1 = yyls;
  660.       short *yyss1 = yyss;
  661.  
  662.       /* Get the current used size of the three stacks, in elements.  */
  663.       int size = yyssp - yyss + 1;
  664.  
  665. #ifdef yyoverflow
  666.       /* Each stack pointer address is followed by the size of
  667.          the data in use in that stack, in bytes.  */
  668.       yyoverflow("parser stack overflow",
  669.                  &yyss1, size * sizeof (*yyssp),
  670.                  &yyvs1, size * sizeof (*yyvsp),
  671.                  &yyls1, size * sizeof (*yylsp),
  672.                  &yymaxdepth);
  673.  
  674.       yyss = yyss1; yyvs = yyvs1; yyls = yyls1;
  675. #else /* no yyoverflow */
  676.       /* Extend the stack our own way.  */
  677.       if (yymaxdepth >= YYMAXLIMIT)
  678.         yyerror("parser stack overflow");
  679.       yymaxdepth *= 2;
  680.       if (yymaxdepth > YYMAXLIMIT)
  681.         yymaxdepth = YYMAXLIMIT;
  682.       yyss = (short *) alloca (yymaxdepth * sizeof (*yyssp));
  683.       bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
  684.       yyvs = (YYSTYPE *) alloca (yymaxdepth * sizeof (*yyvsp));
  685.       bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp));
  686. #ifdef YYLSP_NEEDED
  687.       yyls = (YYLTYPE *) alloca (yymaxdepth * sizeof (*yylsp));
  688.       bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp));
  689. #endif
  690. #endif /* no yyoverflow */
  691.  
  692.       yyssp = yyss + size - 1;
  693.       yyvsp = yyvs + size - 1;
  694. #ifdef YYLSP_NEEDED
  695.       yylsp = yyls + size - 1;
  696. #endif
  697.  
  698. #ifdef YYDEBUG
  699.       if (yydebug)
  700.         fprintf(stderr, "Stack size increased to %d\n", yymaxdepth);
  701. #endif
  702.  
  703.       if (yyssp >= yyss + yymaxdepth - 1)
  704.         YYERROR;
  705.     }
  706.  
  707. #ifdef YYDEBUG
  708.   if (yydebug)
  709.     fprintf(stderr, "Entering state %d\n", yystate);
  710. #endif
  711.  
  712. /* Do appropriate processing given the current state.  */
  713. /* Read a lookahead token if we need one and don't already have one.  */
  714. yyresume:
  715.  
  716.   /* First try to decide what to do without reference to lookahead token.  */
  717.  
  718.   yyn = yypact[yystate];
  719.   if (yyn == YYFLAG)
  720.     goto yydefault;
  721.  
  722.   /* Not known => get a lookahead token if don't already have one.  */
  723.  
  724.   /* yychar is either YYEMPTY or YYEOF
  725.      or a valid token in external form.  */
  726.  
  727.   if (yychar == YYEMPTY)
  728.     {
  729. #ifdef YYDEBUG
  730.       if (yydebug)
  731.         fprintf(stderr, "Reading a token: ");
  732. #endif
  733.       yychar = YYLEX;
  734.     }
  735.  
  736.   /* Convert token to internal form (in yychar1) for indexing tables with */
  737.  
  738.   if (yychar <= 0)              /* This means end of input. */
  739.     {
  740.       yychar1 = 0;
  741.       yychar = YYEOF;           /* Don't call YYLEX any more */
  742.  
  743. #ifdef YYDEBUG
  744.       if (yydebug)
  745.         fprintf(stderr, "Now at end of input.\n");
  746. #endif
  747.     }
  748.   else
  749.     {
  750.       yychar1 = YYTRANSLATE(yychar);
  751.  
  752. #ifdef YYDEBUG
  753.       if (yydebug)
  754.         fprintf(stderr, "Next token is %d (%s)\n", yychar, yytname[yychar1]);
  755. #endif
  756.     }
  757.  
  758.   yyn += yychar1;
  759.   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
  760.     goto yydefault;
  761.  
  762.   yyn = yytable[yyn];
  763.  
  764.   /* yyn is what to do for this token type in this state.
  765.      Negative => reduce, -yyn is rule number.
  766.      Positive => shift, yyn is new state.
  767.        New state is final state => don't bother to shift,
  768.        just return success.
  769.      0, or most negative number => error.  */
  770.  
  771.   if (yyn < 0)
  772.     {
  773.       if (yyn == YYFLAG)
  774.         goto yyerrlab;
  775.       yyn = -yyn;
  776.       goto yyreduce;
  777.     }
  778.   else if (yyn == 0)
  779.     goto yyerrlab;
  780.  
  781.   if (yyn == YYFINAL)
  782.     YYACCEPT;
  783.  
  784.   /* Shift the lookahead token.  */
  785.  
  786. #ifdef YYDEBUG
  787.   if (yydebug)
  788.     fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
  789. #endif
  790.  
  791.   /* Discard the token being shifted unless it is eof.  */
  792.   if (yychar != YYEOF)
  793.     yychar = YYEMPTY;
  794.  
  795.   *++yyvsp = yylval;
  796. #ifdef YYLSP_NEEDED
  797.   *++yylsp = yylloc;
  798. #endif
  799.  
  800.   /* count tokens shifted since error; after three, turn off error status.  */
  801.   if (yyerrstatus) yyerrstatus--;
  802.  
  803.   yystate = yyn;
  804.   goto yynewstate;
  805.  
  806. /* Do the default action for the current state.  */
  807. yydefault:
  808.  
  809.   yyn = yydefact[yystate];
  810.   if (yyn == 0)
  811.     goto yyerrlab;
  812.  
  813. /* Do a reduction.  yyn is the number of a rule to reduce with.  */
  814. yyreduce:
  815.   yylen = yyr2[yyn];
  816.   yyval = yyvsp[1-yylen]; /* implement default value of the action */
  817.  
  818. #ifdef YYDEBUG
  819.   if (yydebug)
  820.     {
  821.       if (yylen == 1)
  822.         fprintf (stderr, "Reducing 1 value via line %d, ",
  823.                  yyrline[yyn]);
  824.       else
  825.         fprintf (stderr, "Reducing %d values via line %d, ",
  826.                  yylen, yyrline[yyn]);
  827.     }
  828. #endif
  829.  
  830.  
  831.   switch (yyn) {
  832.  
  833. case 1:
  834. #line 53 "parse.y"
  835. { /* add default rule */
  836.             int def_rule;
  837.  
  838.             pat = cclinit();
  839.             cclnegate( pat );
  840.  
  841.             def_rule = mkstate( -pat );
  842.  
  843.             finish_rule( def_rule, false, 0, 0 );
  844.  
  845.             for ( i = 1; i <= lastsc; ++i )
  846.                 scset[i] = mkbranch( scset[i], def_rule );
  847.  
  848.             if ( spprdflt )
  849.                 fputs( "YY_FATAL_ERROR( \"flex scanner jammed\" )",
  850.                    temp_action_file );
  851.             else
  852.                 fputs( "ECHO", temp_action_file );
  853.  
  854.             fputs( ";\n\tYY_BREAK\n", temp_action_file );
  855.             ;
  856.     break;}
  857. case 2:
  858. #line 77 "parse.y"
  859. {
  860.             /* initialize for processing rules */
  861.  
  862.             /* create default DFA start condition */
  863.             scinstal( "INITIAL", false );
  864.             ;
  865.     break;}
  866. case 5:
  867. #line 88 "parse.y"
  868. { synerr( "unknown error processing section 1" ); ;
  869.     break;}
  870. case 7:
  871. #line 95 "parse.y"
  872. {
  873.             /* these productions are separate from the s1object
  874.              * rule because the semantics must be done before
  875.              * we parse the remainder of an s1object
  876.              */
  877.  
  878.             xcluflg = false;
  879.             ;
  880.     break;}
  881. case 8:
  882. #line 105 "parse.y"
  883. { xcluflg = true; ;
  884.     break;}
  885. case 9:
  886. #line 109 "parse.y"
  887. { scinstal( nmstr, xcluflg ); ;
  888.     break;}
  889. case 10:
  890. #line 112 "parse.y"
  891. { scinstal( nmstr, xcluflg ); ;
  892.     break;}
  893. case 11:
  894. #line 115 "parse.y"
  895. { synerr( "bad start condition list" ); ;
  896.     break;}
  897. case 14:
  898. #line 123 "parse.y"
  899. {
  900.             /* initialize for a parse of one rule */
  901.             trlcontxt = variable_trail_rule = varlength = false;
  902.             trailcnt = headcnt = rulelen = 0;
  903.             current_state_type = STATE_NORMAL;
  904.             previous_continued_action = continued_action;
  905.             new_rule();
  906.             ;
  907.     break;}
  908. case 15:
  909. #line 134 "parse.y"
  910. {
  911.             pat = yyvsp[0];
  912.             finish_rule( pat, variable_trail_rule,
  913.                      headcnt, trailcnt );
  914.  
  915.             for ( i = 1; i <= actvp; ++i )
  916.                 scbol[actvsc[i]] =
  917.                 mkbranch( scbol[actvsc[i]], pat );
  918.  
  919.             if ( ! bol_needed )
  920.                 {
  921.                 bol_needed = true;
  922.  
  923.                 if ( performance_report )
  924.                 pinpoint_message( 
  925.                 "'^' operator results in sub-optimal performance" );
  926.                 }
  927.             ;
  928.     break;}
  929. case 16:
  930. #line 154 "parse.y"
  931. {
  932.             pat = yyvsp[0];
  933.             finish_rule( pat, variable_trail_rule,
  934.                      headcnt, trailcnt );
  935.  
  936.             for ( i = 1; i <= actvp; ++i )
  937.                 scset[actvsc[i]] =
  938.                 mkbranch( scset[actvsc[i]], pat );
  939.             ;
  940.     break;}
  941. case 17:
  942. #line 165 "parse.y"
  943. {
  944.             pat = yyvsp[0];
  945.             finish_rule( pat, variable_trail_rule,
  946.                      headcnt, trailcnt );
  947.  
  948.             /* add to all non-exclusive start conditions,
  949.              * including the default (0) start condition
  950.              */
  951.  
  952.             for ( i = 1; i <= lastsc; ++i )
  953.                 if ( ! scxclu[i] )
  954.                 scbol[i] = mkbranch( scbol[i], pat );
  955.  
  956.             if ( ! bol_needed )
  957.                 {
  958.                 bol_needed = true;
  959.  
  960.                 if ( performance_report )
  961.                 pinpoint_message(
  962.                 "'^' operator results in sub-optimal performance" );
  963.                 }
  964.             ;
  965.     break;}
  966. case 18:
  967. #line 189 "parse.y"
  968. {
  969.             pat = yyvsp[0];
  970.             finish_rule( pat, variable_trail_rule,
  971.                      headcnt, trailcnt );
  972.  
  973.             for ( i = 1; i <= lastsc; ++i )
  974.                 if ( ! scxclu[i] )
  975.                 scset[i] = mkbranch( scset[i], pat );
  976.             ;
  977.     break;}
  978. case 19:
  979. #line 200 "parse.y"
  980. { build_eof_action(); ;
  981.     break;}
  982. case 20:
  983. #line 203 "parse.y"
  984. {
  985.             /* this EOF applies to all start conditions
  986.              * which don't already have EOF actions
  987.              */
  988.             actvp = 0;
  989.  
  990.             for ( i = 1; i <= lastsc; ++i )
  991.                 if ( ! sceof[i] )
  992.                 actvsc[++actvp] = i;
  993.  
  994.             if ( actvp == 0 )
  995.                 pinpoint_message(
  996.         "warning - all start conditions already have <<EOF>> rules" );
  997.  
  998.             else
  999.                 build_eof_action();
  1000.             ;
  1001.     break;}
  1002. case 21:
  1003. #line 222 "parse.y"
  1004. { synerr( "unrecognized rule" ); ;
  1005.     break;}
  1006. case 23:
  1007. #line 229 "parse.y"
  1008. {
  1009.             if ( (scnum = sclookup( nmstr )) == 0 )
  1010.                 format_pinpoint_message(
  1011.                 "undeclared start condition %s", nmstr );
  1012.  
  1013.             else
  1014.                 actvsc[++actvp] = scnum;
  1015.             ;
  1016.     break;}
  1017. case 24:
  1018. #line 239 "parse.y"
  1019. {
  1020.             if ( (scnum = sclookup( nmstr )) == 0 )
  1021.                 format_pinpoint_message(
  1022.                 "undeclared start condition %s", nmstr );
  1023.             else
  1024.                 actvsc[actvp = 1] = scnum;
  1025.             ;
  1026.     break;}
  1027. case 25:
  1028. #line 248 "parse.y"
  1029. { synerr( "bad start condition list" ); ;
  1030.     break;}
  1031. case 26:
  1032. #line 252 "parse.y"
  1033. {
  1034.             if ( transchar[lastst[yyvsp[0]]] != SYM_EPSILON )
  1035.                 /* provide final transition \now/ so it
  1036.                  * will be marked as a trailing context
  1037.                  * state
  1038.                  */
  1039.                 yyvsp[0] = link_machines( yyvsp[0], mkstate( SYM_EPSILON ) );
  1040.  
  1041.             mark_beginning_as_normal( yyvsp[0] );
  1042.             current_state_type = STATE_NORMAL;
  1043.  
  1044.             if ( previous_continued_action )
  1045.                 {
  1046.                 /* we need to treat this as variable trailing
  1047.                  * context so that the backup does not happen
  1048.                  * in the action but before the action switch
  1049.                  * statement.  If the backup happens in the
  1050.                  * action, then the rules "falling into" this
  1051.                  * one's action will *also* do the backup,
  1052.                  * erroneously.
  1053.                  */
  1054.                 if ( ! varlength || headcnt != 0 )
  1055.                 {
  1056.                 fprintf( stderr,
  1057.     "%s: warning - trailing context rule at line %d made variable because\n",
  1058.                      program_name, linenum );
  1059.                 fprintf( stderr,
  1060.                      "      of preceding '|' action\n" );
  1061.                 }
  1062.  
  1063.                 /* mark as variable */
  1064.                 varlength = true;
  1065.                 headcnt = 0;
  1066.                 }
  1067.  
  1068.             if ( varlength && headcnt == 0 )
  1069.                 { /* variable trailing context rule */
  1070.                 /* mark the first part of the rule as the accepting
  1071.                  * "head" part of a trailing context rule
  1072.                  */
  1073.                 /* by the way, we didn't do this at the beginning
  1074.                  * of this production because back then
  1075.                  * current_state_type was set up for a trail
  1076.                  * rule, and add_accept() can create a new
  1077.                  * state ...
  1078.                  */
  1079.                 add_accept( yyvsp[-1], num_rules | YY_TRAILING_HEAD_MASK );
  1080.                 variable_trail_rule = true;
  1081.                 }
  1082.             
  1083.             else
  1084.                 trailcnt = rulelen;
  1085.  
  1086.             yyval = link_machines( yyvsp[-1], yyvsp[0] );
  1087.             ;
  1088.     break;}
  1089. case 27:
  1090. #line 309 "parse.y"
  1091. { synerr( "trailing context used twice" ); ;
  1092.     break;}
  1093. case 28:
  1094. #line 312 "parse.y"
  1095. {
  1096.             if ( trlcontxt )
  1097.                 {
  1098.                 synerr( "trailing context used twice" );
  1099.                 yyval = mkstate( SYM_EPSILON );
  1100.                 }
  1101.  
  1102.             else if ( previous_continued_action )
  1103.                 {
  1104.                 /* see the comment in the rule for "re2 re"
  1105.                  * above
  1106.                  */
  1107.                 if ( ! varlength || headcnt != 0 )
  1108.                 {
  1109.                 fprintf( stderr,
  1110.     "%s: warning - trailing context rule at line %d made variable because\n",
  1111.                      program_name, linenum );
  1112.                 fprintf( stderr,
  1113.                      "      of preceding '|' action\n" );
  1114.                 }
  1115.  
  1116.                 /* mark as variable */
  1117.                 varlength = true;
  1118.                 headcnt = 0;
  1119.                 }
  1120.  
  1121.             trlcontxt = true;
  1122.  
  1123.             if ( ! varlength )
  1124.                 headcnt = rulelen;
  1125.  
  1126.             ++rulelen;
  1127.             trailcnt = 1;
  1128.  
  1129.             eps = mkstate( SYM_EPSILON );
  1130.             yyval = link_machines( yyvsp[-1],
  1131.                  link_machines( eps, mkstate( '\n' ) ) );
  1132.             ;
  1133.     break;}
  1134. case 29:
  1135. #line 352 "parse.y"
  1136. {
  1137.                 yyval = yyvsp[0];
  1138.  
  1139.             if ( trlcontxt )
  1140.                 {
  1141.                 if ( varlength && headcnt == 0 )
  1142.                 /* both head and trail are variable-length */
  1143.                 variable_trail_rule = true;
  1144.                 else
  1145.                 trailcnt = rulelen;
  1146.                 }
  1147.                 ;
  1148.     break;}
  1149. case 30:
  1150. #line 368 "parse.y"
  1151. {
  1152.             varlength = true;
  1153.             yyval = mkor( yyvsp[-2], yyvsp[0] );
  1154.             ;
  1155.     break;}
  1156. case 31:
  1157. #line 374 "parse.y"
  1158. { yyval = yyvsp[0]; ;
  1159.     break;}
  1160. case 32:
  1161. #line 379 "parse.y"
  1162. {
  1163.             /* this rule is written separately so
  1164.              * the reduction will occur before the trailing
  1165.              * series is parsed
  1166.              */
  1167.  
  1168.             if ( trlcontxt )
  1169.                 synerr( "trailing context used twice" );
  1170.             else
  1171.                 trlcontxt = true;
  1172.  
  1173.             if ( varlength )
  1174.                 /* we hope the trailing context is fixed-length */
  1175.                 varlength = false;
  1176.             else
  1177.                 headcnt = rulelen;
  1178.  
  1179.             rulelen = 0;
  1180.  
  1181.             current_state_type = STATE_TRAILING_CONTEXT;
  1182.             yyval = yyvsp[-1];
  1183.             ;
  1184.     break;}
  1185. case 33:
  1186. #line 404 "parse.y"
  1187. {
  1188.             /* this is where concatenation of adjacent patterns
  1189.              * gets done
  1190.              */
  1191.             yyval = link_machines( yyvsp[-1], yyvsp[0] );
  1192.             ;
  1193.     break;}
  1194. case 34:
  1195. #line 412 "parse.y"
  1196. { yyval = yyvsp[0]; ;
  1197.     break;}
  1198. case 35:
  1199. #line 416 "parse.y"
  1200. {
  1201.             varlength = true;
  1202.  
  1203.             yyval = mkclos( yyvsp[-1] );
  1204.             ;
  1205.     break;}
  1206. case 36:
  1207. #line 423 "parse.y"
  1208. {
  1209.             varlength = true;
  1210.  
  1211.             yyval = mkposcl( yyvsp[-1] );
  1212.             ;
  1213.     break;}
  1214. case 37:
  1215. #line 430 "parse.y"
  1216. {
  1217.             varlength = true;
  1218.  
  1219.             yyval = mkopt( yyvsp[-1] );
  1220.             ;
  1221.     break;}
  1222. case 38:
  1223. #line 437 "parse.y"
  1224. {
  1225.             varlength = true;
  1226.  
  1227.             if ( yyvsp[-3] > yyvsp[-1] || yyvsp[-3] < 0 )
  1228.                 {
  1229.                 synerr( "bad iteration values" );
  1230.                 yyval = yyvsp[-5];
  1231.                 }
  1232.             else
  1233.                 {
  1234.                 if ( yyvsp[-3] == 0 )
  1235.                 yyval = mkopt( mkrep( yyvsp[-5], yyvsp[-3], yyvsp[-1] ) );
  1236.                 else
  1237.                 yyval = mkrep( yyvsp[-5], yyvsp[-3], yyvsp[-1] );
  1238.                 }
  1239.             ;
  1240.     break;}
  1241. case 39:
  1242. #line 455 "parse.y"
  1243. {
  1244.             varlength = true;
  1245.  
  1246.             if ( yyvsp[-2] <= 0 )
  1247.                 {
  1248.                 synerr( "iteration value must be positive" );
  1249.                 yyval = yyvsp[-4];
  1250.                 }
  1251.  
  1252.             else
  1253.                 yyval = mkrep( yyvsp[-4], yyvsp[-2], INFINITY );
  1254.             ;
  1255.     break;}
  1256. case 40:
  1257. #line 469 "parse.y"
  1258. {
  1259.             /* the singleton could be something like "(foo)",
  1260.              * in which case we have no idea what its length
  1261.              * is, so we punt here.
  1262.              */
  1263.             varlength = true;
  1264.  
  1265.             if ( yyvsp[-1] <= 0 )
  1266.                 {
  1267.                 synerr( "iteration value must be positive" );
  1268.                 yyval = yyvsp[-3];
  1269.                 }
  1270.  
  1271.             else
  1272.                 yyval = link_machines( yyvsp[-3], copysingl( yyvsp[-3], yyvsp[-1] - 1 ) );
  1273.             ;
  1274.     break;}
  1275. case 41:
  1276. #line 487 "parse.y"
  1277. {
  1278.             if ( ! madeany )
  1279.                 {
  1280.                 /* create the '.' character class */
  1281.                 anyccl = cclinit();
  1282.                 ccladd( anyccl, '\n' );
  1283.                 cclnegate( anyccl );
  1284.  
  1285.                 if ( useecs )
  1286.                 mkeccl( ccltbl + cclmap[anyccl],
  1287.                     ccllen[anyccl], nextecm,
  1288.                     ecgroup, csize, csize );
  1289.  
  1290.                 madeany = true;
  1291.                 }
  1292.  
  1293.             ++rulelen;
  1294.  
  1295.             yyval = mkstate( -anyccl );
  1296.             ;
  1297.     break;}
  1298. case 42:
  1299. #line 509 "parse.y"
  1300. {
  1301.             if ( ! cclsorted )
  1302.                 /* sort characters for fast searching.  We use a
  1303.                  * shell sort since this list could be large.
  1304.                  */
  1305.                 cshell( ccltbl + cclmap[yyvsp[0]], ccllen[yyvsp[0]], true );
  1306.  
  1307.             if ( useecs )
  1308.                 mkeccl( ccltbl + cclmap[yyvsp[0]], ccllen[yyvsp[0]],
  1309.                     nextecm, ecgroup, csize, csize );
  1310.  
  1311.             ++rulelen;
  1312.  
  1313.             yyval = mkstate( -yyvsp[0] );
  1314.             ;
  1315.     break;}
  1316. case 43:
  1317. #line 526 "parse.y"
  1318. {
  1319.             ++rulelen;
  1320.  
  1321.             yyval = mkstate( -yyvsp[0] );
  1322.             ;
  1323.     break;}
  1324. case 44:
  1325. #line 533 "parse.y"
  1326. { yyval = yyvsp[-1]; ;
  1327.     break;}
  1328. case 45:
  1329. #line 536 "parse.y"
  1330. { yyval = yyvsp[-1]; ;
  1331.     break;}
  1332. case 46:
  1333. #line 539 "parse.y"
  1334. {
  1335.             ++rulelen;
  1336.  
  1337.             if ( caseins && yyvsp[0] >= 'A' && yyvsp[0] <= 'Z' )
  1338.                 yyvsp[0] = clower( yyvsp[0] );
  1339.  
  1340.             yyval = mkstate( yyvsp[0] );
  1341.             ;
  1342.     break;}
  1343. case 47:
  1344. #line 550 "parse.y"
  1345. { yyval = yyvsp[-1]; ;
  1346.     break;}
  1347. case 48:
  1348. #line 553 "parse.y"
  1349. {
  1350.             /* *Sigh* - to be compatible Unix lex, negated ccls
  1351.              * match newlines
  1352.              */
  1353. #ifdef NOTDEF
  1354.             ccladd( yyvsp[-1], '\n' ); /* negated ccls don't match '\n' */
  1355.             cclsorted = false; /* because we added the newline */
  1356. #endif
  1357.             cclnegate( yyvsp[-1] );
  1358.             yyval = yyvsp[-1];
  1359.             ;
  1360.     break;}
  1361. case 49:
  1362. #line 567 "parse.y"
  1363. {
  1364.             if ( yyvsp[-2] > yyvsp[0] )
  1365.                 synerr( "negative range in character class" );
  1366.  
  1367.             else
  1368.                 {
  1369.                 if ( caseins )
  1370.                 {
  1371.                 if ( yyvsp[-2] >= 'A' && yyvsp[-2] <= 'Z' )
  1372.                     yyvsp[-2] = clower( yyvsp[-2] );
  1373.                 if ( yyvsp[0] >= 'A' && yyvsp[0] <= 'Z' )
  1374.                     yyvsp[0] = clower( yyvsp[0] );
  1375.                 }
  1376.  
  1377.                 for ( i = yyvsp[-2]; i <= yyvsp[0]; ++i )
  1378.                     ccladd( yyvsp[-3], i );
  1379.  
  1380.                 /* keep track if this ccl is staying in alphabetical
  1381.                  * order
  1382.                  */
  1383.                 cclsorted = cclsorted && (yyvsp[-2] > lastchar);
  1384.                 lastchar = yyvsp[0];
  1385.                 }
  1386.  
  1387.             yyval = yyvsp[-3];
  1388.             ;
  1389.     break;}
  1390. case 50:
  1391. #line 595 "parse.y"
  1392. {
  1393.             if ( caseins )
  1394.                 if ( yyvsp[0] >= 'A' && yyvsp[0] <= 'Z' )
  1395.                 yyvsp[0] = clower( yyvsp[0] );
  1396.  
  1397.             ccladd( yyvsp[-1], yyvsp[0] );
  1398.             cclsorted = cclsorted && (yyvsp[0] > lastchar);
  1399.             lastchar = yyvsp[0];
  1400.             yyval = yyvsp[-1];
  1401.             ;
  1402.     break;}
  1403. case 51:
  1404. #line 607 "parse.y"
  1405. {
  1406.             cclsorted = true;
  1407.             lastchar = 0;
  1408.             yyval = cclinit();
  1409.             ;
  1410.     break;}
  1411. case 52:
  1412. #line 615 "parse.y"
  1413. {
  1414.             if ( caseins )
  1415.                 if ( yyvsp[0] >= 'A' && yyvsp[0] <= 'Z' )
  1416.                 yyvsp[0] = clower( yyvsp[0] );
  1417.  
  1418.             ++rulelen;
  1419.  
  1420.             yyval = link_machines( yyvsp[-1], mkstate( yyvsp[0] ) );
  1421.             ;
  1422.     break;}
  1423. case 53:
  1424. #line 626 "parse.y"
  1425. { yyval = mkstate( SYM_EPSILON ); ;
  1426.     break;}
  1427. }
  1428.    /* the action file gets copied in in place of this dollarsign */
  1429. #line 303 "bison.simple"
  1430.  
  1431.   yyvsp -= yylen;
  1432.   yyssp -= yylen;
  1433. #ifdef YYLSP_NEEDED
  1434.   yylsp -= yylen;
  1435. #endif
  1436.  
  1437. #ifdef YYDEBUG
  1438.   if (yydebug)
  1439.     {
  1440.       short *ssp1 = yyss - 1;
  1441.       fprintf (stderr, "state stack now");
  1442.       while (ssp1 != yyssp)
  1443.         fprintf (stderr, " %d", *++ssp1);
  1444.       fprintf (stderr, "\n");
  1445.     }
  1446. #endif
  1447.  
  1448.   *++yyvsp = yyval;
  1449.  
  1450. #ifdef YYLSP_NEEDED
  1451.   yylsp++;
  1452.   if (yylen == 0)
  1453.     {
  1454.       yylsp->first_line = yylloc.first_line;
  1455.       yylsp->first_column = yylloc.first_column;
  1456.       yylsp->last_line = (yylsp-1)->last_line;
  1457.       yylsp->last_column = (yylsp-1)->last_column;
  1458.       yylsp->text = 0;
  1459.     }
  1460.   else
  1461.     {
  1462.       yylsp->last_line = (yylsp+yylen-1)->last_line;
  1463.       yylsp->last_column = (yylsp+yylen-1)->last_column;
  1464.     }
  1465. #endif
  1466.  
  1467.   /* Now "shift" the result of the reduction.
  1468.      Determine what state that goes to,
  1469.      based on the state we popped back to
  1470.      and the rule number reduced by.  */
  1471.  
  1472.   yyn = yyr1[yyn];
  1473.  
  1474.   yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
  1475.   if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
  1476.     yystate = yytable[yystate];
  1477.   else
  1478.     yystate = yydefgoto[yyn - YYNTBASE];
  1479.  
  1480.   goto yynewstate;
  1481.  
  1482. yyerrlab:   /* here on detecting error */
  1483.  
  1484.   if (! yyerrstatus)
  1485.     /* If not already recovering from an error, report this error.  */
  1486.     {
  1487.       ++yynerr;
  1488.       yyerror("parse error");
  1489.     }
  1490.  
  1491.   if (yyerrstatus == 3)
  1492.     {
  1493.       /* if just tried and failed to reuse lookahead token after an error, discard it.  */
  1494.  
  1495.       /* return failure if at end of input */
  1496.       if (yychar == YYEOF)
  1497.         YYERROR;
  1498.  
  1499. #ifdef YYDEBUG
  1500.       if (yydebug)
  1501.         fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
  1502. #endif
  1503.  
  1504.       yychar = YYEMPTY;
  1505.     }
  1506.  
  1507.   /* Else will try to reuse lookahead token
  1508.      after shifting the error token.  */
  1509.  
  1510.   yyerrstatus = 3;              /* Each real token shifted decrements this */
  1511.  
  1512.   goto yyerrhandle;
  1513.  
  1514. yyerrdefault:  /* current state does not do anything special for the error token. */
  1515.  
  1516. #if 0
  1517.   /* This is wrong; only states that explicitly want error tokens
  1518.      should shift them.  */
  1519.   yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
  1520.   if (yyn) goto yydefault;
  1521. #endif
  1522.  
  1523. yyerrpop:   /* pop the current state because it cannot handle the error token */
  1524.  
  1525.   if (yyssp == yyss) YYERROR;
  1526.   yyvsp--;
  1527.   yystate = *--yyssp;
  1528. #ifdef YYLSP_NEEDED
  1529.   yylsp--;
  1530. #endif
  1531.  
  1532. #ifdef YYDEBUG
  1533.   if (yydebug)
  1534.     {
  1535.       short *ssp1 = yyss - 1;
  1536.       fprintf (stderr, "Error: state stack now");
  1537.       while (ssp1 != yyssp)
  1538.         fprintf (stderr, " %d", *++ssp1);
  1539.       fprintf (stderr, "\n");
  1540.     }
  1541. #endif
  1542.  
  1543. yyerrhandle:
  1544.  
  1545.   yyn = yypact[yystate];
  1546.   if (yyn == YYFLAG)
  1547.     goto yyerrdefault;
  1548.  
  1549.   yyn += YYTERROR;
  1550.   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
  1551.     goto yyerrdefault;
  1552.  
  1553.   yyn = yytable[yyn];
  1554.   if (yyn < 0)
  1555.     {
  1556.       if (yyn == YYFLAG)
  1557.         goto yyerrpop;
  1558.       yyn = -yyn;
  1559.       goto yyreduce;
  1560.     }
  1561.   else if (yyn == 0)
  1562.     goto yyerrpop;
  1563.  
  1564.   if (yyn == YYFINAL)
  1565.     YYACCEPT;
  1566.  
  1567. #ifdef YYDEBUG
  1568.   if (yydebug)
  1569.     fprintf(stderr, "Shifting error token, ");
  1570. #endif
  1571.  
  1572.   *++yyvsp = yylval;
  1573. #ifdef YYLSP_NEEDED
  1574.   *++yylsp = yylloc;
  1575. #endif
  1576.  
  1577.   yystate = yyn;
  1578.   goto yynewstate;
  1579. }
  1580. #line 629 "parse.y"
  1581.  
  1582.  
  1583.  
  1584. /* build_eof_action - build the "<<EOF>>" action for the active start
  1585.  *                    conditions
  1586.  */
  1587.  
  1588. void build_eof_action()
  1589.  
  1590.     {
  1591.     register int i;
  1592.  
  1593.     for ( i = 1; i <= actvp; ++i )
  1594.     {
  1595.     if ( sceof[actvsc[i]] )
  1596.         format_pinpoint_message(
  1597.         "multiple <<EOF>> rules for start condition %s",
  1598.             scname[actvsc[i]] );
  1599.  
  1600.     else
  1601.         {
  1602.         sceof[actvsc[i]] = true;
  1603.         fprintf( temp_action_file, "case YY_STATE_EOF(%s):\n",
  1604.              scname[actvsc[i]] );
  1605.         }
  1606.     }
  1607.  
  1608.     line_directive_out( temp_action_file );
  1609.     }
  1610.  
  1611.  
  1612. /* synerr - report a syntax error */
  1613.  
  1614. void synerr( str )
  1615. char str[];
  1616.  
  1617.     {
  1618.     syntaxerror = true;
  1619.     pinpoint_message( str );
  1620.     }
  1621.  
  1622.  
  1623. /* format_pinpoint_message - write out a message formatted with one string,
  1624.  *                 pinpointing its location
  1625.  */
  1626.  
  1627. void format_pinpoint_message( msg, arg )
  1628. char msg[], arg[];
  1629.  
  1630.     {
  1631.     char errmsg[MAXLINE];
  1632.  
  1633.     (void) sprintf( errmsg, msg, arg );
  1634.     pinpoint_message( errmsg );
  1635.     }
  1636.  
  1637.  
  1638. /* pinpoint_message - write out a message, pinpointing its location */
  1639.  
  1640. void pinpoint_message( str )
  1641. char str[];
  1642.  
  1643.     {
  1644.     fprintf( stderr, "\"%s\", line %d: %s\n", infilename, linenum, str );
  1645.     }
  1646.  
  1647.  
  1648. /* yyerror - eat up an error message from the parser;
  1649.  *         currently, messages are ignore
  1650.  */
  1651.  
  1652. void yyerror( msg )
  1653. char msg[];
  1654.  
  1655.     {
  1656.     }
  1657.